const state = {
	allMoney: uni.getStorageSync('allMoney') || 0,
	allCount: uni.getStorageSync('allCount') || 0,
	activedList: []
};
const actions = {
	addToCar({ commit }, valueObj) {
		commit('ADD_TO_CAR', valueObj);
		// commit('ADD_ACTIVED_LIST', []);
	},
	addActivedList({ commit }, arr) {
		commit('ADD_ACTIVED_LIST', arr);
	}
};
const mutations = {
	ADD_TO_CAR(state, valueObj) {
		let { total, size } = valueObj;
		state.allCount = size;
		state.allMoney = total;
		uni.setStorageSync('allCount', state.allCount);
		uni.setStorageSync('allMoney', state.allMoney);
	},
	ADD_ACTIVED_LIST(state, arr) {
		state.activedList = arr;
		// uni.setStorageSync('activedList', state.activedList);
	}
};
const getters = {
	allMoney: state => state.allMoney || 0,
	allCount: state => state.allCount || 0,
	activedList: state => state.activedList || []
};
export default {
	namespaced: true,
	actions,
	mutations,
	state,
	getters
};
